package com.ztorn.fiscale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ztorn.fiscale.mapper.FiscaleTaxDeclarationRelationMapper;
import com.ztorn.fiscale.domain.FiscaleTaxDeclarationRelation;
import com.ztorn.fiscale.service.IFiscaleTaxDeclarationRelationService;

/**
 * 报关单发票关联Service业务层处理
 *
 * @author ztorn
 * @date 2025-09-19
 */
@Service
public class FiscaleTaxDeclarationRelationServiceImpl implements IFiscaleTaxDeclarationRelationService
{
    @Autowired
    private FiscaleTaxDeclarationRelationMapper fiscaleTaxDeclarationRelationMapper;

    /**
     * 查询报关单发票关联
     *
     * @param relationId 报关单发票关联ID
     * @return 报关单发票关联
     */
    @Override
    public FiscaleTaxDeclarationRelation selectFiscaleTaxDeclarationRelationById(Long relationId)
    {
        return fiscaleTaxDeclarationRelationMapper.selectFiscaleTaxDeclarationRelationById(relationId);
    }

    /**
     * 查询报关单发票关联列表
     *
     * @param fiscaleTaxDeclarationRelation 报关单发票关联
     * @return 报关单发票关联
     */
    @Override
    public List<FiscaleTaxDeclarationRelation> selectFiscaleTaxDeclarationRelationList(FiscaleTaxDeclarationRelation fiscaleTaxDeclarationRelation)
    {
        return fiscaleTaxDeclarationRelationMapper.selectFiscaleTaxDeclarationRelationList(fiscaleTaxDeclarationRelation);
    }

    /**
     * 根据报关单ID查询报关单发票关联
     *
     * @param declarationId 报关单ID
     * @return 报关单发票关联
     */
    @Override
    public FiscaleTaxDeclarationRelation selectFiscaleTaxDeclarationRelationByDeclarationId(Long declarationId)
    {
        return fiscaleTaxDeclarationRelationMapper.selectFiscaleTaxDeclarationRelationByDeclarationId(declarationId);
    }

    /**
     * 根据发票ID查询报关单发票关联
     *
     * @param invoiceId 发票ID
     * @return 报关单发票关联
     */
    @Override
    public List<FiscaleTaxDeclarationRelation> selectFiscaleTaxDeclarationRelationByInvoiceId(Long invoiceId)
    {
        return fiscaleTaxDeclarationRelationMapper.selectFiscaleTaxDeclarationRelationByInvoiceId(invoiceId);
    }

    /**
     * 新增报关单发票关联
     *
     * @param fiscaleTaxDeclarationRelation 报关单发票关联
     * @return 结果
     */
    @Override
    public int insertFiscaleTaxDeclarationRelation(FiscaleTaxDeclarationRelation fiscaleTaxDeclarationRelation)
    {
        return fiscaleTaxDeclarationRelationMapper.insertFiscaleTaxDeclarationRelation(fiscaleTaxDeclarationRelation);
    }

    /**
     * 批量新增报关单发票关联
     *
     * @param fiscaleTaxDeclarationRelations 报关单发票关联列表
     * @return 结果
     */
    @Override
    public int insertFiscaleTaxDeclarationRelations(List<FiscaleTaxDeclarationRelation> fiscaleTaxDeclarationRelations)
    {
        return fiscaleTaxDeclarationRelationMapper.insertFiscaleTaxDeclarationRelations(fiscaleTaxDeclarationRelations);
    }

    /**
     * 修改报关单发票关联
     *
     * @param fiscaleTaxDeclarationRelation 报关单发票关联
     * @return 结果
     */
    @Override
    public int updateFiscaleTaxDeclarationRelation(FiscaleTaxDeclarationRelation fiscaleTaxDeclarationRelation)
    {
        return fiscaleTaxDeclarationRelationMapper.updateFiscaleTaxDeclarationRelation(fiscaleTaxDeclarationRelation);
    }

    /**
     * 批量删除报关单发票关联
     *
     * @param relationIds 需要删除的报关单发票关联ID
     * @return 结果
     */
    @Override
    public int deleteFiscaleTaxDeclarationRelationByIds(Long[] relationIds)
    {
        return fiscaleTaxDeclarationRelationMapper.deleteFiscaleTaxDeclarationRelationByIds(relationIds);
    }

    /**
     * 根据报关单ID删除报关单发票关联
     *
     * @param declarationId 报关单ID
     * @return 结果
     */
    @Override
    public int deleteFiscaleTaxDeclarationRelationByDeclarationId(Long declarationId)
    {
        return fiscaleTaxDeclarationRelationMapper.deleteFiscaleTaxDeclarationRelationByDeclarationId(declarationId);
    }

    /**
     * 根据发票ID删除报关单发票关联
     *
     * @param invoiceId 发票ID
     * @return 结果
     */
    @Override
    public int deleteFiscaleTaxDeclarationRelationByInvoiceId(Long invoiceId)
    {
        return fiscaleTaxDeclarationRelationMapper.deleteFiscaleTaxDeclarationRelationByInvoiceId(invoiceId);
    }

    /**
     * 删除报关单发票关联信息
     *
     * @param relationId 报关单发票关联ID
     * @return 结果
     */
    @Override
    public int deleteFiscaleTaxDeclarationRelationById(Long relationId)
    {
        return fiscaleTaxDeclarationRelationMapper.deleteFiscaleTaxDeclarationRelationById(relationId);
    }
}
